home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Interactive Media Design Review 1999
/
Interactive Media Design Review 1999.iso
/
pc
/
Demos
/
Herois
/
Codigo.Cst
/
00016_Script_Anima Texto Drag
< prev
next >
Wrap
Text File
|
1999-03-19
|
1KB
|
47 lines
property memberPrim, memberUlt -- Cast members que serao animados
property memPrim, memQuantos -- Membros: em numero
property ultimaTroca -- Hora em que foi feita ultima troca
property fotoAtual
property divide
on getBehaviorDescription
return "Anima sprites"
end
on getPropertyDescriptionList
set p_list = [ ¼
#divide: [ #comment: "Pixels de scroll por animacao", ¼
#format: #integer, ¼
#default: 16 ], ¼
#memberPrim: [ #comment: "Primeiro membro da animacao", ¼
#format: #string, ¼
#default: "" ], ¼
#memberUlt: [ #comment: "Ultimo membro da animacao", ¼
#format: #string, ¼
#default: "" ] ¼
]
return p_list
end
on beginSprite me
set memPrim to the number of member memberPrim
set memQuantos to (the number of member memberUlt) - memPrim + 1
put 0 into fotoAtual
end
on scrollLinha me, quanto
global gMustUpdate
if quanto <> 0 then
-- Descobre qual a proxima figura a trocar
set tmp = (fotoAtual + quanto) mod (memQuantos*divide)
if tmp < 0 then set tmp = tmp + memQuantos*divide
if tmp / divide <> fotoAtual / divide then
-- Muda figura e updateStage
set the member of sprite (the spriteNum of me) to memPrim + (tmp/divide)
set gMustUpdate to true
end if
put tmp into fotoAtual
end if
end